package nowCoder;

import java.util.Scanner;

public class HJ60 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = n >> 1;
        if (is(k)){
            System.out.println(k);
            System.out.println(k);
            return;
        }
        int a = k;
        while(true) {
            for (int i = a-1; i > 1; i--) {
                if (is(i)){
                    a = i;
                    break;
                }
            }
            for (int i = k+1; i <= n; i++) {
                if (is(i)){
                    if (a+i == n) {
                        System.out.println(a);
                        System.out.println(i);
                        return;
                    }
                    else if (a+i > n) {
                        break;
                    }
                }
            }
        }
    }
    public static boolean is(int x){
        for (int i = 2; i <= Math.sqrt(x); i++) {
            if (x % i == 0){
                return false;
            }
        }
        return true;
    }
}
